# Set up some autoload functions
autoload -Uz colors vcs_info

# Now reset the prompt to get colors
colors

# Turn on and configure the version control system information
precmd () { vcs_info }
zstyle ':vcs_info:*' get-revision true
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' formats '%u%c|%s:%b'
zstyle ':vcs_info:*' actionformats '%c%u|%s@%a:%b'
zstyle ':vcs_info:*' branchformat '%b@%r'
zstyle ':vcs_info:*' unstagedstr "%{$fg_no_bold[red]%}"
zstyle ':vcs_info:*' stagedstr "%{$fg_no_bold[yellow]%}"
zstyle ':vcs_info:*' enable fossil hg svn git cvs # p4 off, but must be last.

# vcs-specific formatting...
zstyle ':vcs_info:hg*:*' hgrevformat "%r"
zstyle ':vcs_info:fossil:*' fsrevformat '%.5h'
# Silly git doesn't honor branchformat
zstyle ':vcs_info:git*:*' formats '%c%u|%s@%a:%b@%.5i'
zstyle ':vcs_info:git*:*' actionformats '%c%u|%s@%a:%b@%.5i'

# now use the blasted colors!
setopt PROMPT_SUBST
RPROMPT='%{$fg_no_bold[magenta]%}%~%{$fg_no_bold[green]%}${vcs_info_msg_0_}%{$reset_color%}'
